import request from "@/utils/request";
import type { AxiosPromise } from "axios";
import type { FileInfo } from "./types";

export function uploadFileApi(file:File):AxiosPromise<FileInfo>{
    const formData = new FormData();
    formData.append('file',file);
    // 请求接口
    return request({
        url:"/youlai-system/api/v1/files",
        method:"post",
        data:formData,
        headers:{
            "Content-Type":"multipart/form-data"
        }
    })
}